package com.fang.fen.blog.common.utils;

import com.fang.fen.blog.common.exception.ApplicationException;
import com.fang.fen.blog.common.vo.Response;
import org.apache.commons.lang3.StringUtils;

public class ResponseUtil {

    private final static String ERROR_CODE = StringUtils.EMPTY;

    private final static String MESSAGE = StringUtils.EMPTY;

    public static Response convertException(ApplicationException e) {
        return new Response(e.getErrorCode(), e.getMessage());
    }

    public static Response success(Object o) {
        return new Response(ERROR_CODE, MESSAGE, o);
    }

}

